public class SM4Turn {

    public static int[] encrypt(int[] plain, int[] initkey) {
        int[] key = Key.keyGenerator(initkey);
        int[] cipher = plain;
        for(int i = 0; i < 32; i++) {
            int tmp = cipher[0]^SM4change.Tchange(cipher[1]^cipher[2]^cipher[3]^key[i]);
            for(int j = 0; j < 3; j++)
                cipher[j] = cipher[j+1];
            cipher[3] = tmp;
        }
        return cipher;
    }
}